Fixed issues with reporting sync state events from different threads#6341
Merged
bmarty merged 1 commit intoelement-hq:developfrom Jul 25, 2022
Merged
Fixed issues with reporting sync state events from different threads#6341bmarty merged 1 commit intoelement-hq:developfrom
bmarty merged 1 commit intoelement-hq:developfrom
Conversation
bmarty
reviewed
Jun 17, 2022
Member
bmarty
left a comment
There was a problem hiding this comment.
Thanks for the PR. One first remark.
...droid/src/main/java/org/matrix/android/sdk/internal/session/sync/handler/GroupSyncHandler.kt
Outdated
Show resolved
Hide resolved
bmarty
approved these changes
Jun 30, 2022
Member
bmarty
left a comment
There was a problem hiding this comment.
Thanks for the update (and sorry for the delay to review it). Just one remark about the Kdoc, then this can be merged. For the remark about the CoroutineScope we will handle it.
Note that I will squash and merge your commits to cleanup the Git history. Feel free to squash your commits and force push if you want to.
matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncService.kt
Show resolved
Hide resolved
...ndroid/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncRequestStateTracker.kt
Show resolved
Hide resolved
Contributor
Author
|
Hi @bmarty, are there still any issues preventing this to be merged? |
bmarty
approved these changes
Jul 22, 2022
Member
bmarty
left a comment
There was a problem hiding this comment.
Thanks for the update.
I have triggered the CI on this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Content
Replaced
LiveDatawithFlowfor sync state reporting.Motivation and context
SyncRequestStateTrackerinstance is reused in different threads, because of theScopeannotation. IfLiveData::postValueis called fast enough, some events can get lost, because only the last one is dispatched.So in my case I could reproduce loosing of
InitialSyncRequestState.Idledue to sendingIncrementalSyncIdlefrom another thread.Signed-off-by: Artjom König artkoenig@gmail.com